<div class="sidebar-header d-flex align-items-center">
    <div id="avatar" @click="toUserLook" class="avatar"><img :src="loginUser.pic" alt="..." class="img-fluid rounded-circle"></div>
    <div class="title">
        <h1 class="h5">{{loginUser.realName}}</h1>
        <p>{{loginUser.deptName}}</p>
    </div>
</div>
<script>
    new Vue({
        el: ".sidebar-header",
        data: {
            loginUser: {}
        },
        methods: {
            toUserLook:function () {
                window.location.href = '/html/user_look.html'
            }
        },
        created: function () {
            this.loginUser = JSON.parse(localStorage.getItem("loginUser"));
        }
    })
</script>